
public class BinarySemaphore extends Semaphore {
	
	public BinarySemaphore(){
		super();
	}
	public BinarySemaphore(int initial){
		
		value=(initial>=1)?1:0;
	}
	
	public synchronized void V(){
		if(value == 0){
			value++;
		}
		notify();
	}
}

